package com.doyens.gmall.product.client;

import com.doyens.gmall.model.product.BaseCategoryView;
import com.doyens.gmall.model.product.SkuInfo;
import com.doyens.gmall.model.product.SpuSaleAttr;
import com.doyens.gmall.product.client.impl.ProductFeignClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value ="service-product", fallback = ProductFeignClientImpl.class)
public interface ProductFeignClient {

    /**
     * 根据skuId获取sku信息
     *
     * @param skuId
     * @return
     */
    @GetMapping("api/product/inner/getSkuInfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);
    //根据三级别分类id查询分类信息
    @GetMapping("api/product/inner/getCategoryView/{category3Id}")
     BaseCategoryView getCategoryView(@PathVariable("category3Id") Long category3Id);
    @GetMapping("api/product/inner/getSkuPrice/{skuId}")
     BigDecimal getSkuPrice(@PathVariable("skuId")Long skuId);
    @GetMapping("api/product/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
     List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable("skuId")Long skuId, @PathVariable("spuId")Long spuId);

    //根据spuid获取销售属性值id  与skuid 组成的map、
    @GetMapping("api/product/inner/getSkuValueIdsMap/{spuId}")
     Map getSkuValueIdsMap(@PathVariable("spuId")Long spuId);



}